package com.ruoyi.rocketmq;

import org.springframework.stereotype.Component;

@Component("mqTask")
public class MqTask {

    /*@Resource
    private DefaultMQProducer producer;*/

    /**
     * 每10秒执行一次
     */
//    @Scheduled(cron = "0/10 * *  * * ?")
    public void sendMsgToMq() {
        /*String str = "发送测试消息";
        Message msg;
        try {
            msg = new Message("test-demo"
                    , "111"
                    , UUID.randomUUID().toString()
                    , str.getBytes("utf-8"));
            SendResult result = producer.send(msg);
            if (result.getSendStatus() == SendStatus.SEND_OK) {
                System.out.println("消息发送成功");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }*/
    }
/*
————————————————
    版权声明：本文为CSDN博主「酷爱编程的小猿同学」的原创文章，遵循CC 4.0 BY-SA版权协议，转载请附上原文出处链接及本声明。
    原文链接：https://blog.csdn.net/qq_43037478/article/details/115703530*/
}
